package com.cloud.controller;

import com.cloud.config.rabbitmq.RabbitmqService;
import com.cloud.task.ExaminationTask;
import com.cloud.utils.Result;
import com.cloud.utils.ResultUtils;
import com.cloud.utils.TaskManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TaskController {
    @Autowired
    private TaskManager taskManager;
    @Autowired
    private RabbitmqService rabbitmqService;
    @PostMapping(value = "examination/task")
    public Result addTask() throws Exception{
    rabbitmqService.sendMsg("fdkhh","你好！");
    taskManager.addTask("ss","ddd","20 39 21 27 11 ? ", ExaminationTask.class);
        return ResultUtils.success("添加成功");
    }
}
